<template>
  <div>
    <BasicTable @register="registerTable" :rowSelection="rowSelection"></BasicTable>
  </div>
</template>
<script lang="ts" setup name="userGoodsTotal">
import { BasicTable } from '@apps/antd-admin/src/components/table';
import { useBaseTable } from '@apps/antd-admin/src/hooks';
import { Api } from './data/api';
import { columns, searchFormSchema } from './data/data';
import { useMessage } from '@apps/antd-admin/src/hooks/web/useMessage';

const { createMessage, createConfirm } = useMessage();

const { prefixCls, tableContext, handleDelete, handleSuccess, handlePost, handleBatchDelete } = useBaseTable({
  designScope: 'userGoodsTotal-template',
  tableProps: {
    //表格标题
    title: '会员卡统计列表',
    //主键字段
    rowKey: 'userGoodsId',
    //列表查询handler
    handlerName: 'appUserGoodsTotalListHandler',
    //列表接口
    listUrl: Api.page,
    //列定义
    columns,
    //查询表单配置
    formConfig: {
      labelWidth: 120,
      schemas: searchFormSchema,
      showExportButton: true,
      exportButtonOptions: {
        code: 'ACTION_userGoodsTotalExport',
      },
    },
    showActionColumn: false,
    clickToRowSelect: true,
    rowSelection: {
      type: 'radio',
    },
  },
});

const [registerTable, { getForm, setProps, reload }, { rowSelection, hasSelectedRows, selectedRow }] = tableContext;
</script>
